package com.w2cx.selenium.page;

import com.w2cx.selenium.base.DriverBase;
import com.w2cx.selenium.util.Locator;
import org.openqa.selenium.WebElement;

import java.util.List;

public class MarkLibraryManagePage extends BasePage {

    DriverBase driver;
    public MarkLibraryManagePage(DriverBase driver){
        super(driver);
    }




    //获取“基础数据管理”菜单
    public WebElement getBaseDataManageMenu(){
        List<WebElement> list = elements(Locator.getByLocator("firstMenuList"));
        WebElement element = list.get(3);
        System.out.println("找到元素:"+element.getText());
        return element;
    }

    //获取“标签库管理”菜单
    public WebElement getMarkLibraryManageMenu(){
        List<WebElement> list = elements(Locator.getByLocator("BaseDataSecondMenu"));
        WebElement element = list.get(1);
        System.out.println("找到元素:"+element.getText());
        return element;
    }



    //获取“添加”按钮
    public WebElement getMarkLibraryManageAddBtn(){
        WebElement element = element(Locator.getByLocator("markLibraryAddBtn"));
        System.out.println("找到元素:"+element.getText());
        return element;
    }

    //获取“资讯标题”输入框
    public WebElement getInformationTitleInput(){
        WebElement element = element(Locator.getByLocator("markNameInput"));
        System.out.println("找到元素:"+element.getText());
        return element;
    }

    //获取“资讯分类”下拉框
    public WebElement getInformationCategory(){
        WebElement element = element(Locator.getByLocator("markInformationCategory"));
        System.out.println("找到元素:"+element.getText());
        return element;
    }

    //获取某个分类选项
    public WebElement getInformationCatSelect(){
        WebElement element = element(Locator.getByLocator("markInformationCategorySelect"));
        System.out.println("找到元素:"+element.getText());
        return element;
    }


    //获取“确认”按钮
    public WebElement getReviewBtn(){
        WebElement element = element(Locator.getByLocator("markAddConfirmBtn"));
        System.out.println("找到元素:"+element.getText());
        return element;
    }


    //获取第一级标签列表
    public List<WebElement> getMarkLibraryLevel0List(){
        List<WebElement> list = elements(Locator.getByLocator("markLibraryLevel0List"));
        return list;
    }


    //获取删除按钮  在所在行元素中查找删除按钮
    public WebElement getDelBtn(WebElement fatherElement){
        WebElement delBtn = fatherElement.findElement(Locator.getByLocator("markDelBtn"));
        return delBtn;
    }

    //获取确定按钮
    public WebElement getOkBtn(){
        WebElement element = element(Locator.getByLocator("markLibraryDelOkBtn"));
        return element;
    }


}
